<!DOCTYPE HTML>
<html style="background: #f3f3f3">
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>签约网</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../css/lawyer_user.css"/>
    <script type="text/javascript" src="../script/api.js"></script>
    <script type="text/javascript" src="../script/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="../script/mobile.js"></script>
    <script type="text/javascript" src="../script/lawyer.js"></script>
    <script type="text/javascript">
      window['adaptive'].desinWidth = 750;
      window['adaptive'].baseFont = 28;
      window['adaptive'].maxWidth = 750;
      window['adaptive'].init();
    </script>
    <style type="text/css">
        .zd_price{
            padding: 0.6rem 0.3rem 0.4rem;
            background: #fff;
            margin-bottom: 0.25rem;
            text-align: center;
            font-size: 0.3rem;
            color: #333333;
            line-height: 0.48rem;
        }
        .zd_price .userImg{
            display: block;
            width: 1.5rem;
            height: 1.5rem;
            margin: 0 auto 0.25rem;
            border-radius: 50%;
        }
        .zd_price span{
            font-weight: bold;
            color: #f3a538;
            font-size: 0.36rem;
            font-family: Arial;
        }
        .zd_info{
            background: #FFFFFF;
            padding: 0.2rem 0;
        }
        .zd_info ul li{
            padding: 0 0.3rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            height: 0.8rem;
            font-size: 0.28rem;
            color: #333333;
        }
        .zd_info ul li p{
            color: #8f8f8f;
        }
    </style>
</head>

<body style="background: #f3f3f3">
<header class="header">
    <a href="javascript:void(0);" onclick="comeBack()" class="back_btn"><img src="../image/head-fanhui.png" alt=""></a>
    <h2>账单详情</h2>
    <!--<a href="javascript:void(0);" class="qiandao_btn">注册</a>-->
</header>

<div class="zhangdan">
    <div class="zd_price">
        <img class="userImg" id='userImg' src="../image/user_tx.png" alt="">
        <p id="form">图文咨询费用-来自 138****5632</p>
        <span id="money">+230.00</span>
    </div>
    <div class="zd_info">
        <ul>
            <li><p>费用类型</p><span id="kinds">图文咨询</span></li>
            <li id="dfName"><p>对方名称</p><span id="tel">138****5632</span></li>
            <li><p>转账时间</p><span id="time">2019-12-15 12:55</span></li>
            <li class="order_num"><p>交易单号</p><span id="order_num">536558431346463</span></li>
        </ul>
    </div>
</div>


</body>

<script>
var id;
apiready = function () {
    api.addEventListener({
        name: 'keyback'
    }, function (ret, err) {
        api.closeWin();
    });
    id = api.pageParam.id;

    toDoRequest();
};

function toDoRequest() {
    var p = {
        token:token,
        id: id
    }
    api.ajax({
        url: webSiteUrl + '/app/staff/waterDetail',
        method: 'post',
        data: {
            values: p
        }
    }, function (ret, err) {
        console.log(JSON.stringify(ret));
        if (ret.code == 200) {
          var info = ret.data;

          if(info!=''||info!=null||typeof(info)!=undefined){

            if(info.user!=''){
              $("#userImg").attr('src',webSiteUrl+info.user.icon);
              var tel = info.user.phone;
              tel = tel.substr(0, 3) + '****' + tel.substring(7, 11);
              $("#tel").html(tel);

              if(info.type == 2){
                $("#form").html('来自'+tel+'支付的费用')
              }else {
                $("#form").html(info.water_title);
              }


            }else{
              $("#form").html(info.water_title);
              $("#dfName").hide();
              $("#userImg").attr('src',webSiteUrl+'/Public/Home/img/user_tx.png');
            }


            $("#kinds").html(info.water_title);
            $("#time").html(info.create_time);
            if(info.order_number ==''||info.order_number ==null){
              $(".order_num").hide();
            }else {
              $("#order_num").html(info.order_number);
            }


            if(info.type == 2){
              $("#money").html('-'+info.new_price);
            }else {
              $("#money").html('+'+info.new_price);
            }
          }

        } else {

        }
    });

}
</script>

</html>
